<?php

class m120416_202227_create_blog_structure extends CDbMigration
{
	public function up()
	{
		$this->createTable('post', array(
			'id'=>'pk',
			'title'=>'string NOT NULL',
			'date_time'=>'datetime',
			'image_url'=>'string',
			'resume'=>'string',
			'content'=>'text',
			'user_id'=>'integer',
		));
		$this->addForeignKey('post_user', 'post', 'user_id', 'user', 'id');
	}

	public function down()
	{
		$this->dropTable('post');
	}

	/*
	// Use safeUp/safeDown to do migration with transaction
	public function safeUp()
	{
	}

	public function safeDown()
	{
	}
	*/
}